package io.gitee.zicai.bus.publish;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;

import javax.annotation.Resource;

/**
 * EventBusPublisher
 *
 * @author zicai
 * @since 2021-01-22
 */
public class EventBusPublisher<B extends ApplicationEvent> implements IBusPublisher<B> {

    @Resource
    private ApplicationContext applicationContext;

    @Override
    public void publish(B bus) {
        applicationContext.publishEvent(bus);
    }
}
